package com.vm.osm.business.dto.eam.equ;

import com.google.common.base.MoreObjects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

/**
 * 获取企业资产分页请求
 *
 * @author Xuerong Xue
 */
@Data
public class SearchEamEquRsp implements Serializable {
    @ApiModelProperty("总记录数")
    private Long total_num;
    @ApiModelProperty("分页数")
    private Integer page_num;
    @ApiModelProperty("分页大小")
    private Integer page_size;
    @ApiModelProperty(value = "数据列表", dataType = "SearchEamEquRsp.EnterpriseEquInfoItem")
    private List<EnterpriseEquInfoItem> data_list;

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("total_num", total_num)
                .add("page_num", page_num)
                .add("page_size", page_size)
                .add("data_list", null == data_list ? null : Arrays.toString(data_list.toArray()))
                .toString();
    }

    @Data
    @ApiModel("SearchEamEquRsp.EnterpriseEquInfoItem")
    public static class EnterpriseEquInfoItem {
        @ApiModelProperty("设备Id")
        private String id;
        @ApiModelProperty("设备编码")
        private String equ_code;
        @ApiModelProperty("设备类型名称")
        private String equ_type_name;
        @ApiModelProperty("设备类型Id")
        private String equ_type_id;
        @ApiModelProperty("品牌")
        private String brand;
        @ApiModelProperty("型号")
        private String model;
        @ApiModelProperty("所属类型（1：仓库、2：设备、3：部门、4：人员）")
        private Byte belong_type;
        @ApiModelProperty("所属部门")
        private String department_name;
        @ApiModelProperty("存放仓库")
        private String ware_house_name;
        @ApiModelProperty("使用人")
        private String staff_name;
        @ApiModelProperty("设备状态（1：闲置、2：在用、3：借用、4：报废、5：丢失、6：维护锁定、7：故障锁定、8：分配锁定）")
        private Byte status;
        @ApiModelProperty("购买日期")
        private Long purchase_date;

        @Override
        public String toString() {
            return MoreObjects.toStringHelper(this)
                    .add("id", id)
                    .add("equ_code", equ_code)
                    .add("equ_type_name", equ_type_name)
                    .add("equ_type_id", equ_type_id)
                    .add("brand", brand)
                    .add("model", model)
                    .add("belong_type", belong_type)
                    .add("department_name", department_name)
                    .add("ware_house_name", ware_house_name)
                    .add("staff_name", staff_name)
                    .add("status", status)
                    .add("purchase_date", purchase_date)
                    .toString();
        }
    }
}
